﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using CommunitySystem.Assert;
using CommunitySystem.Ctrls;

namespace CommunitySystem.Views
{
    public static class NavMoveSwitchEx
    {
        public static ReturnAsyncCtrl ShowNextPage(this NavMoveSwitch nav, string title, AsyncCtrl ctrl)
        {
            ctrl.Nav = nav;
            ReturnAsyncCtrl page = new ReturnAsyncCtrl(ctrl) { Nav = nav, Title =title };
            nav.SetNextPage(page);
            nav.MoveNext();
            return page;
        }

        public static ReturnAsyncCtrl ShowNextPage(this NavMoveSwitch nav, string title, AsyncCtrl ctrl, IReturnListenerc prevPage)
        {
            ctrl.Nav = nav;
            ReturnAsyncCtrl page = new ReturnAsyncCtrl(ctrl) { Nav = nav, PrevPage = prevPage, Title = title };
            nav.SetNextPage(page);
            nav.MoveNext();
            return page;
        }
  
    }
}
